package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class CmsHotRecommend implements Serializable {

	private static final long serialVersionUID = -5193415239560910285L;

	//fields
	private java.lang.Integer id;
	private java.lang.Long prodId;
	private java.lang.String title;
	private java.lang.String link;
	private java.lang.String pic;
	private java.lang.Integer displayOrder;

	//default constructor
	public CmsHotRecommend() {
	}

	//getter
	public java.lang.Integer getId() {
		return id;
	}
	public java.lang.Long getProdId() {
		return prodId;
	}
	public java.lang.String getTitle() {
		return title;
	}
	public java.lang.String getLink() {
		return link;
	}
	public java.lang.String getPic() {
		return pic;
	}
	public java.lang.Integer getDisplayOrder() {
		return displayOrder;
	}

	//setter
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public void setProdId(java.lang.Long prodId) {
		this.prodId = prodId;
	}
	public void setTitle(java.lang.String title) {
		this.title = title;
	}
	public void setLink(java.lang.String link) {
		this.link = link;
	}
	public void setPic(java.lang.String pic) {
		this.pic = pic;
	}
	public void setDisplayOrder(java.lang.Integer displayOrder) {
		this.displayOrder = displayOrder;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof CmsHotRecommend))
			return false;

		final CmsHotRecommend cmsHotRecommend = (CmsHotRecommend)other;
		if (!this.id.equals(cmsHotRecommend.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("CmsHotRecommend[")
			.append("id=").append(id).append(", ")
			.append("prodId=").append(prodId).append(", ")
			.append("title=").append(title).append(", ")
			.append("link=").append(link).append(", ")
			.append("pic=").append(pic).append(", ")
			.append("displayOrder=").append(displayOrder).append("]").toString();
	}

	///#################
	private Product product;

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
	  public String getPicPath() {
	        if (pic == null) {
	            return null;
	        }
	        return com.ibuonline.b2b.common.ResourceUtil.getResPath(pic);
	    }
	
}
